let user = require('./User');

console.log(`userName:${user.userName}`);



/*创建服务器*/
let http = require('http');
let url = require('url');
let util = require('util');

let server = http.createServer((req, res) => {
    res.statusCode = 200;

    res.setHeader('Content-Type', 'application/json');

    console.log('url:' + req.url); //index.html?id=996

    console.log('parse:' + url.parse((req.url))); //[object]

    console.log('inspect:' + util.inspect(url.parse(req.url))); //字符化上面一个

    res.end(util.inspect(url.parse(req.url)));

}).listen(3000, '127.0.0.1', () => {
    console.log('服务启动成功');
});